﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using OpenTKLightingTool.Data;

namespace OpenTKLightingTool.Controls
{
    /// <summary>
    /// Interaction logic for LightingControl.xaml
    /// </summary>
    public partial class LightingControl : UserControl
    {
        public LightingControl()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Sets data to UX
        /// </summary>
        internal void SetLighting(Lighting lighting)
        {
            uxGlobalAmbient.Value = lighting.GlobalAmbient;
            uxLocalViewer.IsChecked = lighting.LocalViewer;
            uxLocalViewer.IsChecked = lighting.TwoSided;
        }

        /// <summary>
        /// Gets data from UX
        /// </summary>
        internal Lighting GetLighting()
        {
            Lighting lighting = new Lighting();

            lighting.GlobalAmbient = uxGlobalAmbient.Value;
            lighting.LocalViewer = uxLocalViewer.IsChecked.Value;
            lighting.TwoSided = uxTwoSided.IsChecked.Value;

            return lighting;
        }
    }
}
